import random

class IdentityTraining:

    def __init__(self) -> None:
        self.identity = {}
        self.identity["老爸"] = "440301196310250913"
        self.identity["老妈"] = "440301196603250941"
        self.identity["老婆"] = "440923199401194368"
        self.identity["瑞瑞"] = "440303202110140059"
        self.keys = []
        for k in self.identity.keys(): self.keys.append(k)        
        self.randidx = 0        
        
    def start(self):
        n = ""
        result = True
        while(n != "q"):
            if result: # 重新出题
                self.randidx = self.generateRandomIdx()
            
            q = self.keys[self.randidx]
            a = self.identity[q]
            n = input(f"{q}:")

            if n == 'q':
                print("退出")
                break
            try:   
                if a == n:
                    result = True
                    print("正确")                    
                else:
                    result = False
                    print("错误")                    
            except:
                pass

    def generateRandomIdx(self)->int:
            randidx_tmp = random.randint(0,len(self.identity) - 1)
            while(randidx_tmp == self.randidx):            
                randidx_tmp = random.randint(0,len(self.identity) - 1)
            return randidx_tmp

IdentityTraining().start()